﻿using Core.SimpleTemp.Common;
using Core.SimpleTemp.Common.FilterExpression;
using Core.SimpleTemp.Repositories.Internal;
using Core.Toolkit.BaseLibrary.Emit;
using Core.Toolkit.Core.Application;
using Core.Toolkit.Core.Entitys;
using Core.Toolkit.Core.Repositories.Internal;
using Core.Toolkit.PagingQuery;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace Core.SimpleTemp.Application
{
    public static class DateTimeFormat
    {
        
        
        public static DateTime? getTime(DateTime? t, string type)
        {
            DateTime? dt = new DateTime();
            if (type == "b")
            {
                string str = t == null ? "" : ((DateTime)t).ToString("yyyy-MM-dd") + " 00:00:00";
                if (str != "")
                    dt = Convert.ToDateTime(str);
                else
                    dt = null;

            }
            else
            {

                string str = t == null ? "" : ((DateTime)t).ToString("yyyy-MM-dd") + " 23:59:59";
                if (str != "")
                    dt = Convert.ToDateTime(str);
                else
                    dt = null;
            }

            return dt;

        }

    }
}
